<%- 
  index ||= putofacture_counter
  new_or_existing = putofacture.new_record? ? 'new' : 'existing'
  id_or_index = putofacture.new_record? ? nil : putofacture.id 
  prefix = "pulve[#{new_or_existing}_putofacture_attributes][]" 
-%> 

<div class="putofacture"> 
<% fields_for prefix, putofacture do |putofacture_form| -%> 
<table>
	<tr>
		<td> <%= putofacture_form.collection_select (:facture_id, Facture.find(:all), :id, :name, {}, :index => id_or_index ) %></td>
		<td> Valeur : <%= putofacture_form.text_field :value, :index => id_or_index, :size => 4 %> </td>
		<td> <%= link_to_function "supprimer", "$(this).up('.putofacture').remove()" %> </td>
	</tr>
</table>
<% end -%> 
</div> 
